package com.server;

import io.grpc.Server;
import io.grpc.ServerBuilder;

import java.io.IOException;

public class GrpcServer {
    public static void main(String[] args) throws IOException, InterruptedException {
        ServerBuilder<?> serverBuilder = ServerBuilder.forPort(9000);
//        发布服务
        serverBuilder.addService(new HelloServiceImpl());
        serverBuilder.addService(new FutureServiceImpl());
        Server build = serverBuilder.build();
//        启动服务端监听客户端连接
        build.start();
        build.awaitTermination();
    }
}
